package com.ruoyi.manager.service.impl.impl;

import com.ruoyi.manager.mapper.TeacherAnalysisMapper;
import com.ruoyi.manager.service.TeachAnalysisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
@Service
public class TeachAnalysisServiceImpl implements TeachAnalysisService {

    @Autowired
    TeacherAnalysisMapper teacherAnalysisMapper;

    @Override
    public List<Map<String, Object>> listClassesInfor() {
        return teacherAnalysisMapper.listClassesInfor();
    }

    @Override
    public List<Map<String, Object>> listClassesInfor3() {
        return teacherAnalysisMapper.listClassesInfor3();
    }

    @Override
    public List<Map<String, Object>> listClassesInfor2() {
        return teacherAnalysisMapper.listClassesInfor2();
    }

    @Override
    public Map<String, Integer> listStudentLevelCount() {
        return teacherAnalysisMapper.listStudentLevelCount();
    }

    @Override
    public List<Map<String, Object>> listClassesAvgScore() {
        return teacherAnalysisMapper.listClassesAvgScore();
    }

    @Override
    public List<Map<String, Object>> listCS() {
        return teacherAnalysisMapper.listCS();
    }

    @Override
    public Map<String, Object> scoreInfo() {
        //总成绩
        Map<String,Object>map1=teacherAnalysisMapper.getscore_sum();
        //平均成绩
        Map<String,Object>map2=teacherAnalysisMapper.getscore_avg();

        map1.putAll(map2);

        return map1;
    }


    @Override
    public Map<String, Object> exInfo() {
        //核心作业完成率
        Map<String,Object>map1 = teacherAnalysisMapper.getcoreExCompleteRate();
        //核心作业提交率
        Map<String,Object>map2 = teacherAnalysisMapper.getcoreExCommitRate();
        //40%以下占比
        Map<String,Object>map3 = teacherAnalysisMapper.getcoreExLt40Rate();
        //80%以上占比
        Map<String,Object>map4 = teacherAnalysisMapper.getcoreExGt80Rate();

        map1.putAll(map2);
        map1.putAll(map3);
        map1.putAll(map4);

        return map1;
    }

    @Override
    public List<Map<String,Object>> listExamNumber() {
        return teacherAnalysisMapper.listExamNumber();
    }

    @Override
    public List<Map<String, Object>> exerciseSum() {
        return teacherAnalysisMapper.exerciseSum();
    }

    @Override
    public List<Map<String, Object>> citySum() {
        return teacherAnalysisMapper.citySum();
    }

}
